package com.glory.dgcpcpda.adapter;

import android.view.View;
import android.widget.RadioButton;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.dgcpcpda.R;
import com.glory.dgcpcpda.entity.MaintainEntity;
import com.glory.dgcpcpda.entity.SchedulingEntity;

import java.util.List;

public class PMSchedulingAdapter extends BaseQuickAdapter<MaintainEntity.PmsScheduleResults, BaseViewHolder> {

   public PMSchedulingAdapter(@Nullable List<MaintainEntity.PmsScheduleResults> data) {
      super(R.layout.item_pm_scheduling,data);
   }

   @Override
   protected void convert(BaseViewHolder helper, MaintainEntity.PmsScheduleResults item) {
      helper.setText(R.id.tvSheetName,item.getSheetName());
      helper.setText(R.id.tvPeriodId,item.getPeriodId());
      helper.setText(R.id.tvScheduleDate,item.getScheduleDate());
      helper.setText(R.id.tvReserved8,item.getReserved8());
      RadioButton button= helper.getView(R.id.rbCheck);
      if (item.isCheck()){
         button.setChecked(true);
      }else {
         button.setChecked(false);
      }
   }
}
